<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <!-- v-show 修改元素的display属性 -->
    <div id="app">
        <button @click="changeIsShow">改变显示</button>
        <br>
        <img src="./img/monkey.gif" alt="monkey" v-show="isShow">
        <!-- <img src="./img/monkey.gif" alt="monkey" v-show="false">
        <img src="./img/monkey.gif" alt="monkey" v-show="isShow">
        <img src="./img/monkey.gif" alt="monkey" v-show="age>=20"> -->
    </div>

    <script src="./lib/vue.js"></script>
    <script>
        var app = new Vue({
            el: "#app",
            data: {
                isShow: true,
                age: 20
            },
            methods: {
                changeIsShow: function () {
                    // 对自身进行取反
                    this.isShow = !this.isShow
                }
            }
        })
    </script>

</body>

</html>